<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class FrontendUserAddAgentId extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::table('frontend_users', function (Blueprint $table) {
            $table->bigInteger('agent_id')->index()->comment('用户所属代理商ID');
            $table->string('status', 16)->default(\App\Enums\AvailableStatus::ENABLED)->comment('用户状态');
            $table->dropColumn(['real_name']);
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::table('frontend_users', function (Blueprint $table) {
            $table->dropColumn(['agent_id', 'status']);
        });
    }
}
